package com.ruoyi.yf.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.yf.mapper.YfHospitalIndividuationDataMapper;
import com.ruoyi.yf.domain.YfHospitalIndividuationData;
import com.ruoyi.yf.service.IYfHospitalIndividuationDataService;
import com.ruoyi.common.core.text.Convert;

/**
 * 医院个性化配置Service业务层处理
 * 
 * @author XiaoYi...
 * @date 2020-08-24
 */
@Service
public class YfHospitalIndividuationDataServiceImpl implements IYfHospitalIndividuationDataService 
{
    @Autowired
    private YfHospitalIndividuationDataMapper yfHospitalIndividuationDataMapper;

    /**
     * 查询医院个性化配置
     * 
     * @param id 医院个性化配置ID
     * @return 医院个性化配置
     */
    @Override
    public YfHospitalIndividuationData selectYfHospitalIndividuationDataById(Long id)
    {
        return yfHospitalIndividuationDataMapper.selectYfHospitalIndividuationDataById(id);
    }

    /**
     * 查询医院个性化配置列表
     * 
     * @param yfHospitalIndividuationData 医院个性化配置
     * @return 医院个性化配置
     */
    @Override
    public List<YfHospitalIndividuationData> selectYfHospitalIndividuationDataList(YfHospitalIndividuationData yfHospitalIndividuationData)
    {
        return yfHospitalIndividuationDataMapper.selectYfHospitalIndividuationDataList(yfHospitalIndividuationData);
    }

    /**
     * 新增医院个性化配置
     * 
     * @param yfHospitalIndividuationData 医院个性化配置
     * @return 结果
     */
    @Override
    public int insertYfHospitalIndividuationData(YfHospitalIndividuationData yfHospitalIndividuationData)
    {
        yfHospitalIndividuationData.setCreateTime(DateUtils.getNowDate());
        return yfHospitalIndividuationDataMapper.insertYfHospitalIndividuationData(yfHospitalIndividuationData);
    }

    /**
     * 修改医院个性化配置
     * 
     * @param yfHospitalIndividuationData 医院个性化配置
     * @return 结果
     */
    @Override
    public int updateYfHospitalIndividuationData(YfHospitalIndividuationData yfHospitalIndividuationData)
    {
        yfHospitalIndividuationData.setUpdateTime(DateUtils.getNowDate());
        return yfHospitalIndividuationDataMapper.updateYfHospitalIndividuationData(yfHospitalIndividuationData);
    }

    /**
     * 删除医院个性化配置对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteYfHospitalIndividuationDataByIds(String ids)
    {
        return yfHospitalIndividuationDataMapper.deleteYfHospitalIndividuationDataByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除医院个性化配置信息
     * 
     * @param id 医院个性化配置ID
     * @return 结果
     */
    @Override
    public int deleteYfHospitalIndividuationDataById(Long id)
    {
        return yfHospitalIndividuationDataMapper.deleteYfHospitalIndividuationDataById(id);
    }


    // 按采集员id获取医院胎盘和危废的配置
    @Override
    public List<YfHospitalIndividuationData> selectYfHospitalTPAndWFConfigListByUid(Long uid) {
        return yfHospitalIndividuationDataMapper.selectYfHospitalTPAndWFConfigListByUid(uid);
    }

}
